package util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;

public class MD5Util {

    public static String md5(String src){
        try {
            MessageDigest md=MessageDigest.getInstance("MD5");

            byte[] b=md.digest(src.getBytes());

            return Base64.getEncoder().encodeToString(b);

        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }

        return null;
    }
}
